﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MAPDavy.Entities;

namespace MAPDavy.Repository
{
    public class TutorRepository:MasterRepository, ITutorRepository
    {

        public int AddTutor(Tutor tutor)
        {
            var ok = 0;

            var existe = (from t in Context.Tutors
                          where t.Id == tutor.Id
                          select t).SingleOrDefault();

            if (existe == null)
            {
                Context.Tutors.Add(tutor);
                Context.SaveChanges();

                ok = 0;
            }

            return ok;
        }
    }
}
